﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace com.eforceglobal.crux.configuration.PasswordManager
{
    public class PasswordManager:IPasswordManager
    {
        public void ValidatePassword(string password)
        {
             XDocument cruxConfigurationDocument = CruxConfigurationManager.LoadConfigFile();
            if (cruxConfigurationDocument != null)
            {
                if(string.IsNullOrEmpty(password))
                {
                    string error = CruxConfigurationManager.GetErrorMessageForPasswordManager("CruxPasswordProvider");
                    throw new PasswordException(error);
                }
            }
        }
    }
}
